home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 418 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: eerie.acsu.buffalo.edu!newserve!rebecca!rpi!not-for-mail
  2. From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
  3. Newsgroups: comp.lang.c++.moderated,comp.lang.c++
  4. Subject: Re: Meaning of the specifier volatile?
  5. Date: 4 Jan 1996 11:45:37 -0000
  6. Organization: Carelcomp Forest
  7. Sender: cppmods@netlab.cs.rpi.edu
  8. Approved: kanze@gabi-soft.fr
  9. Message-ID: <4cgel1$if6@netlab.cs.rpi.edu>
  10. References: <4c9740$27n@netlab.cs.rpi.edu> <4ce5ao$ds3@netlab.cs.rpi.edu>
  11. NNTP-Posting-Host: netlab.cs.rpi.edu
  12.  
  13. X-Original-Date: Thu, 04 Jan 1996 11:47:04 +0200
  14.  
  15. Srinivas Vobilisetti (srv@cs.wayne.edu) wrote:
  16.  
  17. |> I referred to various books on C++ including The C++ 
  18. Programming Language
  19. |> -Bjarne Stroustrup, C++ Primer -Stanley Lipmann, etc.  
  20. Nowhere i could find
  21. |> exact meaning of the specifier volatile. Thanks in advance 
  22. for your help.
  23.  
  24. As told in many replies, volatile specifies that the 
  25. variable's contents can change between its use in the program. 
  26. However, volatile allows you to add another level of checking, 
  27. too. For instance, if you know that your program should never 
  28. change the variable's contents (eg. a memory location for a 
  29. real-time clock value), you can use const volatile. Thus, the 
  30. compiler will check at compile time that your program will not 
  31. modify itself the value, but will prevent optimization of 
  32. using the value once read.
  33.  
  34.  Ari Lukumies
  35.  
  36.  
  37. -- 
  38. All my opinions are mine and mine alone.
  39.  
  40.     [ comp.lang.c++.moderated is a moderated newsgroup.  Submit articles ]
  41.     [  to <c++-submit@netlab.cs.rpi.edu>.  The moderation policy can be  ]
  42.     [   retrieved from <http://netlab.cs.rpi.edu/~cppmods/guide.html>.   ]
  43.     [    Moderators can be reached at: c++-request@netlab.cs.rpi.edu.    ]
  44.